<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('项目发票')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>项目名称：</label>
                                <input type="text" name="xmmc" autoComplete="off"/>
                            </li>
                            <li>
                                <label>单位名称：</label>
                                <input type="text" name="ckdw" autoComplete="off"/>
                            </li>
                            <li>
                                <label>发票编号：</label>
                                <input type="text" name="fpNo" autoComplete="off"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--             <div class="btn-group-sm" id="toolbar" role="group"> -->
<!--                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="gcgl:fkfp:edit"> -->
<!--                     <i class="fa fa-edit"></i> 修改 -->
<!--                 </a> -->
<!--                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="gcgl:fkfp:remove"> -->
<!--                     <i class="fa fa-remove"></i> 删除 -->
<!--                 </a> -->
<!--                 <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="gcgl:fkfp:export"> -->
<!--                     <i class="fa fa-download"></i> 导出 -->
<!--                 </a> -->
<!--             </div> -->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('gcgl:fkfp:edit')}]];
        var removeFlag = [[${@permission.hasPermi('gcgl:fkfp:remove')}]];
        var xmtypedatas = [[${@dict.getType('gcgl_zf_type')}]];
        var prefix = ctx + "gcgl/fkfp";

        $(function() {
            var options = {
                url: prefix + "/list",
                updateUrl: prefix + "/edit/{id}",
                detailUrl: prefix + "/detail/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "发票",
                sortName: "projectno desc",
                sortOrder: "",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '主键',
                    visible: false
                },
                {
                    field: 'gcProjectid',
                    title: '合同ID',
                    visible: false
                },
                {
                    field: 'projectId',
                    title: '管理子项目类型ID',
                    visible: false
                },
                {
                    field: 'fkId',
                    title: '付款ID',
                    visible: false
                },
                {
                    field: 'projectNo',
                    title: '项目编号'
                },
                {
                    field: 'xmmc',
                    title: '项目名称'
                },
                {
                    field: 'ckdw',
                    title: '单位名称'
                },
                {
                    field: 'xmtype',
                    title: '合同类型',
		            formatter: function(value, item, index) {
		            	return $.table.selectDictLabel(xmtypedatas, item.xmtype);
		            }
		        },
                {
                    field: 'orderNo',
                    title: '付款编号',
                    visible: false
                },
                {
                    field: 'fpType',
                    title: '发票类型'
                },
                {
                    field: 'fpjine',
                    title: '发票金额'
                },
                {
                    field: 'fpNo',
                    title: '发票编号(后6位)'
                },
                
                {
                    field: 'fpriq',
                    title: '发票日期',
                    width: '90'
                },
                {
                    field: 'createUser',
                    title: '创建人',
                    visible: false
                },
                {
                    field: 'memo',
                    title: '备注',
                    visible: false
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        if(row.status!=5){
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        }
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-edit"></i>查看</a> ');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>